<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">优惠券名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">类型:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label>
                    <input name="row[type]" type="radio" value="1" {in name="$row.type" value="1"}checked{/in}  onclick="$('.manjian').removeClass('hide');$('.zhekou').addClass('hide')"> 满减券
                </label>
            </div>

            <div class="radio">
                <label>
                    <input name="row[type]" type="radio" value="2" {in name="$row.type" value="2"}checked{/in} onclick="$('.zhekou').removeClass('hide');$('.manjian').addClass('hide')"> 折扣券
                </label>
            </div>
        </div>
    </div>
    <div class="form-group manjian {{$row.type == 1 ? '' :'hide'}}">
        <label class="control-label col-xs-12 col-sm-2">使用条件:</label>
        <div class="col-xs-12 col-sm-8">

			<div class="input-group">
				<div class="input-group-addon">使用限额（元）</div>
				<input id="c-price"  class="form-control" step="0.01" name="row[limit]" value="{$row.limit}" type="number">
				<div class="input-group-addon">面额（元）</div>
				<input id="c-yajin" class="form-control" step="0.01" name="row[amount]" value="{$row.amount}" type="number">
			</div>

        </div>
    </div>
    <div class="form-group zhekou  {{$row.type == 2 ? '' :'hide'}}">
        <label class="control-label col-xs-12 col-sm-2">折扣比例:</label>
        <div class="col-xs-12 col-sm-8">
			<div class="input-group">
				<input class="form-control" step="0.01" name="row[zhekou]" type="number" value="{$row.amount}" placeholder="如填0.01为1%">
			</div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">权重:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control"  name="row[weigh]" type="text" value="{$row.weigh}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
